import axios from 'axios';

import LoginInstance from '@/views/login-page/models/LoginInstance';

export const getUserInfo = () => axios.post('/api/v1/user/info');
export const login = (body: LoginInstance) => axios.post('/api/v1/login/loginByPassword', body.loginByPassword);
export const loginByPhone = (body: LoginInstance) => axios.post('/api/v1/login/loginByCode', body.loginByCode);
export const register = (body: LoginInstance) => axios.post('/api/v1/user/register', body.registerBody);
export const logout = () => axios.post('/logout');
export const getCaptchaCode = (body: LoginInstance) => axios.post('/captchaCode', body.phoneCode);
export const getDefaultPlatform = () => axios.get('/api/v1/platform/card/type/start');
